﻿using System;
using System.Diagnostics.Contracts;
using System.IO;
using OpenLS.Spreadsheet.Formats.Biff.Tokens;

namespace OpenLS.Spreadsheet.Formats.Biff.Records
{
    internal class FtMacro
    {
        private ObjFmla fmla;
        private ushort ft;

        public void Write(BinaryWriter writer)
        {
            writer.Write(ft);
            this.fmla.Write(writer);
        }

        public void Read(BinaryReader reader)
        {
            this.ft = reader.ReadUInt16();
            Contract.Assert(this.ft == 0x0004);
            this.fmla = new ObjFmla();
            fmla.Read(reader, false);
        }
    }
}